// import request from 'umi-request';
import request from '@/utils/request';
import requestString from '@/utils/requestString.tsx';
import { TableListParams } from './data.d';

export async function queryPrivateCustomers(params: TableListParams) {
  return request(MC_PATH + '/api/privateCustomer', {
    params,
  });
}

/**
 * 新增报关抬头
 * @param data
 * @returns {Promise<any>}
 */
export async function createPrivateCustomer(data) {

  return request(MC_PATH + '/api/privateCustomer', {
    method: 'POST',
    requestType:'form',
    data,
  });
}

/**
 * 修改报关抬头信息
 * @param data
 * @returns {Promise<any>}
 */
export async function baseInfo(data) {
  return request(MC_PATH + "/api/privateCustomer", {
    method: 'PUT',
    requestType:'form',
    data
  });
}

/**
 * 删除报关抬头
 * @param {any} id
 * @returns {Promise<any>}
 */
export async function deletePrivateCustomer({ id }) {
  return request(MC_PATH + '/api/privateCustomer/' + id, {
    method: 'DELETE',
    data: { id },
  });
}

/**
 * 根据ID查询报关抬头详情
 * @param {any} id
 * @returns {Promise<any>}
 */
export async function getPrivateCustomer({ id }) {
  return request(MC_PATH + '/api/privateCustomer/'+id, {
    method: 'GET',
    data: {id},
  });
}


// /**
//  * 分页查询报关抬头   列表 +按钮
//  * @param data
//  * @returns {Promise<any>}
//  */
// export async function queryPrivateCustomers({cstId,cstName,page,}) {
//   return request(MC_PATH + '/api/privateCustomer', {
//     method: 'GET',
//     data:{cstId,cstName,page: page.page, size: page.size}
//   });
// }

/**
 * 查询报关抬头
 * @param data
 * @returns {Promise<any>}
 */
export async function queryAllPrivateCustomers({cstId,cstName}) {
  return request(MC_PATH + '/api/privateCustomer/all', {
    method: 'GET',
    data:{cstId,cstName}
  });
}
